package com.example.lab2.api.controller.v1;

import com.example.lab2.domain.entity.Job;
import com.example.lab2.service.JobService;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/v1/job")
public class JobController {

    private final JobService jobService;

    public JobController(JobService jobService) {
        this.jobService = jobService;
    }

    /**
     * 根据JobId获取信息
     *
     * @param jobId JobId
     * @return
     */
    @GetMapping
    public Job getJob(@RequestParam("jobId") String jobId) {
        return jobService.findJobById(jobId);
    }

    @PostMapping
    public void updateJob(@RequestBody Job job) {
        // 执行更新操作
    }

}
